﻿@model IEnumerable<Viettel.VOFFICE.Web.Models.RoleModel>
@{
    ViewBag.Title = "Quản lý vai trò";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@section Styles{
    <script src="@Url.Content("~/Scripts/page/admin.manageroles.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/jquery.jqGrid/ui.jqgrid.css")" rel="stylesheet" type="text/css" ></link>
}

<div class="styler">
    <fieldset class="ui-widget">
        <legend class="ui-state-legend-default ui-corner-top ui-corner-bottom">Danh sách vai trò</legend>
        <div id="Role_Container">
            <input type="button" value="Create New" class="Add" id="btnCreateNew" />
            <table id="Role_List">
                <tr>
                    <th>
                        Ký hiệu
                    </th>
                    <th>
                        Tên vai trò
                    </th>
                    <th>
                        Mô tả
                    </th>
                    <th>
                    </th>
                </tr>
            </table>
            <div id="RoleEditDialog" style="height: 350px" title="Xóa thông tin">
                <div class="styler">
                    <div class="ui-widget" id="Role_Edit">
                        <div id="valSum">
                        </div>
                    </div>
                </div>
            </div>
            <div id="UserListDialog" style="height: 250px" title="Danh sách người dùng">
                <div class="styler">
                    <table class="ui-widget" id="UserList">
                        
                    </table>
                </div>
            </div>
        </div>        
        <script id='Role-Template' type='text/template'>
                <td><%=RoleName%></td><td><%=RoleDisplayName%></td> <td><%=Description%></td>                
                <td><input type="button" value= "Người dùng" class="UserList" /> |<input type="button" value= "Sửa" class="Edit" /> | <input type="button" value= "Xóa" class="Delete" />                 
            </td>                
        </script>
        <script id="user-template" type="text/template">
                 <td><input type="checkbox" id='<%= UserName%>' class='chkitem' value='<%= UserName %>' <%= IsInRole ? "checked='checked'" : "" %> /> </td>
                 <td><label for='<%= UserName %>'><%= UserName %></label></td>
        </script>
        <script id='Role-Edit-Template' type='text/template'>
               <tr>
                <td>
                    <div class="editor-label">
                        Ký hiệu</div>
                    <div class="editor-field">
                        <input type="text" class="gName" value='<%=RoleName%>' />
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label">
                        Tên vai trò</div>
                    <div class="editor-field">
                        <input type="text" class="gDisp" value='<%=RoleDisplayName%>' />
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label">
                        Mô tả</div>
                    <div class="editor-field">
                        <textarea class="gDesc"><%=Description%></textarea>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="button" value="Cập nhật" class="Update" /> | <input type="button" id="btnCancel" value="Hủy" class="Cancel" />
                </td>
            </tr> 
        </script>
        <script id='Role-Delete-Template' type='text/template'>
            <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;
            width: 500px">
                <p>
                <span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Confirm</strong><br />
                Bạn có chắc chắn muốn xóa vai trò: - <%=RoleName%> ?</p>
            </div><br/>
            <table>                
                <tr>
                    <td colspan="2">
                        <input type="button" value="Xóa" class="Update" /> | <input type="button" id="btnCancel" value="Hủy" class="Cancel" />
                    </td>
                </tr>
            </table>
        </script>
    </fieldset>
</div>
